home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / HyperCard-SuperCard / reference / Papers / background_6849.txt < prev    next >
Text File  |  1989-07-09  |  12KB  |  520 lines

  1. -- background: 6849 from stack: in
  2. -- bmap block id: 3714
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openCard
  8.   if field "ID" is empty then
  9.     get location of field "ID"
  10.     click at it
  11.   end if
  12.   if background field "Special Case" is empty then
  13.     set hilite of background button "Special Case" to false
  14.   else
  15.     set hilite of background button "Special Case" to true
  16.   end if
  17. end openCard
  18.  
  19.  
  20. -- part 1 (field)
  21. -- low flags: 00
  22. -- high flags: 4000
  23. -- rect: left=29 top=63 right=82 bottom=157
  24. -- title width / last selected line: 0
  25. -- icon id / first selected line: 0 / 0
  26. -- text alignment: 0
  27. -- font id: 3
  28. -- text size: 12
  29. -- style flags: 0
  30. -- line height: 16
  31. -- part name: ID
  32.  
  33.  
  34. -- part 2 (field)
  35. -- low flags: 00
  36. -- high flags: 4000
  37. -- rect: left=45 top=95 right=145 bottom=505
  38. -- title width / last selected line: 0
  39. -- icon id / first selected line: 0 / 0
  40. -- text alignment: 0
  41. -- font id: 3
  42. -- text size: 12
  43. -- style flags: 0
  44. -- line height: 16
  45. -- part name: Title
  46.  
  47.  
  48. -- part 3 (field)
  49. -- low flags: 00
  50. -- high flags: 4000
  51. -- rect: left=68 top=159 right=193 bottom=505
  52. -- title width / last selected line: 0
  53. -- icon id / first selected line: 0 / 0
  54. -- text alignment: 0
  55. -- font id: 3
  56. -- text size: 12
  57. -- style flags: 0
  58. -- line height: 16
  59. -- part name: Authors
  60.  
  61.  
  62. -- part 4 (field)
  63. -- low flags: 00
  64. -- high flags: 4000
  65. -- rect: left=63 top=211 right=230 bottom=309
  66. -- title width / last selected line: 0
  67. -- icon id / first selected line: 0 / 0
  68. -- text alignment: 0
  69. -- font id: 3
  70. -- text size: 12
  71. -- style flags: 0
  72. -- line height: 16
  73. -- part name: Journal
  74.  
  75.  
  76. -- part 5 (field)
  77. -- low flags: 00
  78. -- high flags: 4000
  79. -- rect: left=158 top=247 right=265 bottom=208
  80. -- title width / last selected line: 0
  81. -- icon id / first selected line: 0 / 0
  82. -- text alignment: 0
  83. -- font id: 3
  84. -- text size: 12
  85. -- style flags: 0
  86. -- line height: 16
  87. -- part name: Volume
  88.  
  89.  
  90. -- part 6 (field)
  91. -- low flags: 00
  92. -- high flags: 4000
  93. -- rect: left=370 top=247 right=265 bottom=420
  94. -- title width / last selected line: 0
  95. -- icon id / first selected line: 0 / 0
  96. -- text alignment: 0
  97. -- font id: 3
  98. -- text size: 12
  99. -- style flags: 0
  100. -- line height: 16
  101. -- part name: Number
  102.  
  103.  
  104. -- part 7 (field)
  105. -- low flags: 00
  106. -- high flags: 4000
  107. -- rect: left=158 top=279 right=297 bottom=208
  108. -- title width / last selected line: 0
  109. -- icon id / first selected line: 0 / 0
  110. -- text alignment: 0
  111. -- font id: 3
  112. -- text size: 12
  113. -- style flags: 0
  114. -- line height: 16
  115. -- part name: Beginning Page
  116.  
  117.  
  118. -- part 8 (field)
  119. -- low flags: 00
  120. -- high flags: 4000
  121. -- rect: left=370 top=279 right=297 bottom=420
  122. -- title width / last selected line: 0
  123. -- icon id / first selected line: 0 / 0
  124. -- text alignment: 0
  125. -- font id: 3
  126. -- text size: 12
  127. -- style flags: 0
  128. -- line height: 16
  129. -- part name: Ending Page
  130.  
  131.  
  132. -- part 9 (field)
  133. -- low flags: 00
  134. -- high flags: 4000
  135. -- rect: left=158 top=311 right=329 bottom=208
  136. -- title width / last selected line: 0
  137. -- icon id / first selected line: 0 / 0
  138. -- text alignment: 0
  139. -- font id: 3
  140. -- text size: 12
  141. -- style flags: 0
  142. -- line height: 16
  143. -- part name: Year
  144.  
  145.  
  146. -- part 12 (button)
  147. -- low flags: 00
  148. -- high flags: A002
  149. -- rect: left=165 top=26 right=47 bottom=237
  150. -- title width / last selected line: 0
  151. -- icon id / first selected line: 0 / 0
  152. -- text alignment: 1
  153. -- font id: 0
  154. -- text size: 12
  155. -- style flags: 0
  156. -- line height: 16
  157. -- part name: Abstracts
  158. ----- HyperTalk script -----
  159. on mouseUp
  160.   set the lockScreen to true
  161.   put field "ID" into temp
  162.   go to first card of "Abstracts"
  163.   if temp is empty then exit mouseUp
  164.   find temp in field "ID"
  165.   if the result is empty then
  166.     exit mouseUp
  167.   end if
  168.   go to last card of "Abstracts"
  169.   doMenu "New Card"
  170.   put temp into field "ID"
  171. end mouseUp
  172.  
  173.  
  174. -- part 13 (button)
  175. -- low flags: 00
  176. -- high flags: A002
  177. -- rect: left=240 top=26 right=47 bottom=316
  178. -- title width / last selected line: 0
  179. -- icon id / first selected line: 0 / 0
  180. -- text alignment: 1
  181. -- font id: 0
  182. -- text size: 12
  183. -- style flags: 0
  184. -- line height: 16
  185. -- part name: Key Words
  186. ----- HyperTalk script -----
  187. on mouseUp
  188.   set the lockScreen to true
  189.   put field "ID" into temp
  190.   go to first card of "Key Words"
  191.   if temp is empty then exit mouseUp
  192.   find temp in field "ID"
  193.   if the result is empty then
  194.     exit mouseUp
  195.   end if
  196.   go to last card of "Key Words"
  197.   doMenu "New Card"
  198.   put temp into field "ID"
  199. end mouseUp
  200.  
  201.  
  202. -- part 16 (button)
  203. -- low flags: 00
  204. -- high flags: A002
  205. -- rect: left=319 top=26 right=47 bottom=357
  206. -- title width / last selected line: 0
  207. -- icon id / first selected line: 0 / 0
  208. -- text alignment: 1
  209. -- font id: 0
  210. -- text size: 12
  211. -- style flags: 0
  212. -- line height: 16
  213. -- part name: Sort
  214. ----- HyperTalk script -----
  215. on mouseUp
  216.   sort by field "ID"
  217. end mouseUp
  218.  
  219.  
  220.  
  221. -- part 18 (button)
  222. -- low flags: 00
  223. -- high flags: A002
  224. -- rect: left=360 top=26 right=47 bottom=421
  225. -- title width / last selected line: 0
  226. -- icon id / first selected line: 0 / 0
  227. -- text alignment: 1
  228. -- font id: 0
  229. -- text size: 12
  230. -- style flags: 0
  231. -- line height: 16
  232. -- part name: Options
  233. ----- HyperTalk script -----
  234. on mouseUp
  235.   go to card "Options" of "Reference Frame"
  236. end mouseUp
  237.  
  238.  
  239.  
  240. -- part 20 (button)
  241. -- low flags: 00
  242. -- high flags: 2000
  243. -- rect: left=456 top=10 right=63 bottom=490
  244. -- title width / last selected line: 0
  245. -- icon id / first selected line: 1014 / 1014
  246. -- text alignment: 1
  247. -- font id: 0
  248. -- text size: 12
  249. -- style flags: 0
  250. -- line height: 16
  251. -- part name: Prev
  252. ----- HyperTalk script -----
  253. on mouseUp
  254.   go prev card of this background
  255. end mouseUp
  256.  
  257.  
  258.  
  259. -- part 21 (button)
  260. -- low flags: 00
  261. -- high flags: 2000
  262. -- rect: left=478 top=10 right=63 bottom=512
  263. -- title width / last selected line: 0
  264. -- icon id / first selected line: 1013 / 1013
  265. -- text alignment: 1
  266. -- font id: 0
  267. -- text size: 12
  268. -- style flags: 0
  269. -- line height: 16
  270. -- part name: Next
  271. ----- HyperTalk script -----
  272. on mouseUp
  273.   go next card of this background
  274. end mouseUp
  275.  
  276.  
  277.  
  278. -- part 25 (button)
  279. -- low flags: 00
  280. -- high flags: 2000
  281. -- rect: left=425 top=19 right=55 bottom=464
  282. -- title width / last selected line: 0
  283. -- icon id / first selected line: 21060 / 21060
  284. -- text alignment: 1
  285. -- font id: 0
  286. -- text size: 12
  287. -- style flags: 0
  288. -- line height: 16
  289. -- part name: Help
  290. ----- HyperTalk script -----
  291. on mouseUp
  292.   global expert
  293.   set the lockScreen to true
  294.   push card
  295.   go to card "Papers-Help" of "Reference Frame"
  296.   if expert is not true then show card field "Papers-Help"
  297. end mouseUp
  298.  
  299.  
  300.  
  301. -- part 28 (button)
  302. -- low flags: 80
  303. -- high flags: A003
  304. -- rect: left=170 top=60 right=79 bottom=229
  305. -- title width / last selected line: 0
  306. -- icon id / first selected line: 0 / 0
  307. -- text alignment: 1
  308. -- font id: 0
  309. -- text size: 12
  310. -- style flags: 0
  311. -- line height: 16
  312. -- part name: Export
  313. ----- HyperTalk script -----
  314. on mouseUp
  315.   global exportFile, exportNumber
  316.   set the cursor to 4
  317.   put output(exportNumber) into it
  318.   put exportNumber + 1 into exportNumber
  319. end mouseUp
  320.  
  321. --
  322. -- output() writes this current record to file exportFile
  323. --
  324. function output number
  325. global prefix, wrtNumbers, numberAffix, howMany, order, affix , nBlankL, exportFile
  326.  
  327. put prefix into string
  328. if wrtNumbers is true then
  329.   put string & number & numberAffix into string
  330. end if
  331. --
  332. -- check to see if this is a special case
  333. --
  334. if background field "Special Case" is not empty then
  335.   put string & background field "Special Case" into string
  336. else                                 -- build a normal reference --
  337.   repeat with i = 1 to howMany
  338.     if item i of order is "authors" then
  339.       put string & buildAuthors(field "authors") & line i of affix into string
  340.     else
  341.       put string & field item i of order & line i of affix into string
  342.     end if
  343.   end repeat
  344. end if
  345.  
  346. write wrap(string) to file exportFile
  347. repeat with i = 1 to nBlankL + 1
  348.   write return to file exportFile
  349. end repeat
  350. end output
  351.  
  352. --
  353. -- buildAuthors() builds author list in correct format
  354. --
  355. function buildAuthors authors
  356. global authorOrder, authorsAffix
  357. put authorOrder into order
  358. put authorsAffix into affix
  359.  
  360. put number of items in authors into numAuthors
  361. put item 1 of authors into name
  362. put firstName(name) into firstN
  363. if char 1 of firstN is " " then delete char 1 of firstN
  364. put lastName(name) into lastN
  365. if char 1 of order is "f" then
  366.   put firstN & line 1 of affix & lastN into outStr
  367. else
  368.   put lastN & line 1 of affix & firstN into outStr
  369. end if
  370. delete char 1 to 2 of order
  371. delete line 1 of affix
  372.  
  373. repeat with n = 2 to numAuthors - 1
  374.   put outStr & line 1 of affix into outStr
  375.   put item n of authors into name
  376.   put firstName(name) into firstN
  377.   if char 1 of firstN is " " then delete char 1 of firstN
  378.   put lastName(name) into lastN
  379.   if char 1 of order is "f" then
  380.     put outStr & firstN & line 2 of affix & lastN into outStr
  381.   else
  382.     put outStr & lastN & line 2 of affix & firstN into outStr
  383.   end if
  384. end repeat
  385. if numAuthors < 2 then return outStr
  386.  
  387. delete char 1 to 2 of order
  388. delete line 1 to 2 of affix
  389. put outStr & line 1 of affix into outStr
  390. put item numAuthors of authors into name
  391. put firstName(name) into firstN
  392. if char 1 of firstN is " " then delete char 1 of firstN
  393. put lastName(name) into lastN
  394. if char 1 of order is "f" then
  395.   put outStr & firstN & line 2 of affix & lastN into outStr
  396. else
  397.   put outStr & lastN & line 2 of affix & firstN into outStr
  398. end if
  399. return outStr
  400. end buildAuthors
  401.  
  402. --
  403. -- firstName() returns first name from string name
  404. --
  405. function firstName name
  406. put offset(last word of name,name) - 1 into numOfChars
  407. if char numOfChars of name is " " then
  408.   put numOfChars - 1 into numOfChars
  409. end if
  410. return char 1 to numOfChars of name
  411. end firstName
  412.  
  413.  
  414. --
  415. -- lastName() returns last name from string name
  416. --
  417. function lastName name
  418. put last word of name into temp
  419. if char 1 of temp is quote then
  420.   delete char 1 of temp
  421.   repeat with i = 1 to number of chars in temp
  422.     if char i of temp is quote then delete char i of temp
  423.   end repeat
  424. end if
  425. return temp
  426. end lastName
  427.  
  428. --
  429. -- wrap() breaks string into lines of at most 80 characters
  430. --
  431. function wrap string
  432. put number of chars in string into nChars
  433. put "80" into start
  434. put "1" into stop
  435. repeat
  436.   if start > nChars then exit repeat
  437.   put start into i
  438.   repeat while i > stop
  439.     if char i of string is space then
  440.       put return into char i of string
  441.       put i + 1 into stop
  442.       put 79 + stop into start
  443.       exit repeat
  444.     end if
  445.     put i - 1 into i
  446.   end repeat
  447.   if i is stop then
  448.     repeat with i = start to nChars
  449.       if char i of string is space then
  450.         put return into char i of string
  451.         put i + 1 into stop
  452.         put 79 + stop into start
  453.         exit repeat
  454.       end if
  455.     end repeat
  456.   end if
  457. end repeat
  458. return string
  459. end wrap
  460.  
  461.  
  462.  
  463. -- part 32 (button)
  464. -- low flags: 00
  465. -- high flags: 8003
  466. -- rect: left=318 top=208 right=230 bottom=415
  467. -- title width / last selected line: 0
  468. -- icon id / first selected line: 0 / 0
  469. -- text alignment: 1
  470. -- font id: 0
  471. -- text size: 12
  472. -- style flags: 0
  473. -- line height: 16
  474. -- part name: Special Case
  475. ----- HyperTalk script -----
  476. on mouseUp
  477.   show background button "Finished Special Case"
  478.   show background field "Special Case"
  479. end mouseUp
  480.  
  481.  
  482.  
  483. -- part 30 (field)
  484. -- low flags: 80
  485. -- high flags: 4001
  486. -- rect: left=1 top=94 right=329 bottom=505
  487. -- title width / last selected line: 0
  488. -- icon id / first selected line: 0 / 0
  489. -- text alignment: 0
  490. -- font id: 3
  491. -- text size: 12
  492. -- style flags: 0
  493. -- line height: 16
  494. -- part name: Special Case
  495.  
  496.  
  497. -- part 31 (button)
  498. -- low flags: 80
  499. -- high flags: A003
  500. -- rect: left=3 top=62 right=86 bottom=161
  501. -- title width / last selected line: 0
  502. -- icon id / first selected line: 0 / 0
  503. -- text alignment: 1
  504. -- font id: 0
  505. -- text size: 12
  506. -- style flags: 0
  507. -- line height: 16
  508. -- part name: Finished Special Case
  509. ----- HyperTalk script -----
  510. on mouseUp
  511.   hide background button "Finished Special Case"
  512.   hide background field "Special Case"
  513.   if background field "Special Case" is not empty then
  514.     set hilite of background button "Special Case" to true
  515.   else
  516.     set hilite of background button "Special Case" to false
  517.   end if
  518. end mouseUp
  519.  
  520.